package com.cy.arc.jy.arcontroller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ArcController {
    @RequestMapping("/doComput/{n1}/{n2}")
    public String doCompute(@PathVariable Integer n1, @PathVariable Integer n2) {
        try {
            Integer div = n1 / n2;
            return "div is" + div;
        } catch (ArithmeticException e) {
            if (n2 == 0)
                return "n2不能为0";
        }

    }
}
